#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
using namespace std;

int main()
{
	char str[10] = { 0 };
	int N = 0;
	int num = 0;
	int count = 0;

	scanf("%d", &N);
	do
	{
		scanf("%s", str);
		getchar();
		if (count % N == 0 && count != 0)
		{
			printf("       ->%s\n", str);
			count = 0;
		}
		else
		{
			if (str[0] == 'C')
			{
				printf("      ->%s\n", "Bu");
			}
			else if (str[0] == 'B')
			{
				printf("      ->%s\n", "JianDao");
			}
			else if (str[0] == 'J')
			{
				printf("      ->%s\n", "ChuiZi");
			}
			else
				;
			count++;
		}
	} while (str[0] != 'E');


	return 0;
}
